export const handleInsert = (table, data) => {
    return new Promise((resolve, reject) => {
        table.insert(data, (err, newDec) => {
            if (err) reject(err);
            else resolve(newDec);
        });
    })
}

export const handleFind = (table, data) => {
    return new Promise((resolve, reject) => {
        table.find(data, (err, newDec) => {
            if (err) reject(err);
            else resolve(newDec);
        });
    })
}